<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //{}
        let object={
            "name":"wuwu",
            "age":18
        }
        console.log(object)
        //new object
        let obj1=new Object()
        obj1.name="weiwei"
        obj1.age=19
        console.log(obj1.name)
        console.log(obj1.age)
        //构造函数
        function Person(name,age,height){
            this.name=name
            this.age=age
            this.height=height
            this.sayhello=a=>{
                console.log(a)
            }
        }
        let p1=new Person()
        p1.sayhello("hello")
        p1.name="qiqi"
        p1.age=20
        p1.height=180
        console.log(p1.name,p1.age,p1.height)
        let p2=new Person()
        p2.sayhi=function(b){
            console.log(b)
        }
        p2.sayhi("hi")
        p2.name="yueyue"
        p2.age=21
        p2.height=181
        console.log(p2.name,p2.age,p2.height)
    </script>
</body>
</html>